package DesignPattern.StrategyPattern;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;


public class OptStrategyContext{
 

    private Map<String, Opt> strategyMap = new ConcurrentHashMap<>();
 

    public OptStrategyContext(Map<String, Opt> strategyMap) {
        this.strategyMap.clear();
        this.strategyMap.putAll(strategyMap);
    }
 
    public int apply(String opt, int a, int b) {
        return strategyMap.get(opt).apply(a, b);
    }
}
